package edu.xust.dto;

import java.io.IOException;
import java.util.Properties;

/**
 * 主要用于存放各种提示信息
 *
 * @author:LG
 * @date:Created at 2019/03/09
 */
public class Messages {
    //学生模块
    public static String getAllStudentSuccess = "";
    public static String getAllStudentFail = "";
    public static String getStudentByIdSuccess = "";
    public static String getStudentByIdFail = "";
    private static String addStudentSuccess = "";


    //教师模块
    public static String getTeachersSuccess = "";

    //后期服务模块
    private static String findAllPostServiceSuccess = "";
    private static String addPostServiceSuccess = "";
    private static String changePostService = "";
    private static String findPostServiceByPIDSuccess = "";
    private static String findPostServiceByPIDFail = "";


    //站点模块
    private static String getAllStationsSuccess = "";
    private static String getStationByIdSuccess = "";
    private static String addStationSuccess = "";


    //运输订单模块
    public static String findAllPostOrders = "";
    public static String findAllDriversSuccess = "";
    public static String findAllDriversFail = "";


    //管理员模块
    public static String findAllAdminSuccess = "";
    public static String addAdminSuccess = "";
    public static String addAdminFail = "";
    public static String deleteAdminSuccess = "";

    static {
        Properties prop = new Properties();// 空的配置类
        try {
            prop.load(Messages.class.getResourceAsStream("/messages.properties"));// Object.class找到jvm运行的class文件所在的目录，
        } catch (IOException e) {
            e.printStackTrace();
        }

        // getResourceAsStream 以流的形式将文件读到内存，不写/ 根路径表示当前class所在的文件夹下面找文件 写
        // 根路径就是当前项目下面找文件 bin
        getAllStudentSuccess = prop.get("getAllStudentSuccess").toString();
        getAllStudentFail = prop.get("getAllStudentFail").toString();
        getStudentByIdSuccess = prop.get("getStudentByIdSuccess").toString();
        addStudentSuccess = prop.get("addStudentSuccess").toString();

        //教师模块
        getTeachersSuccess = prop.get("getTeachersSuccess").toString();

        getStudentByIdFail = prop.get("getStudentByIdFail").toString();

        //后期服务模块
        findAllPostServiceSuccess = prop.get("findAllPostServiceSuccess").toString();
        addPostServiceSuccess = prop.get("addPostServiceSuccess").toString();
        changePostService = prop.get("changePostService").toString();
        findPostServiceByPIDSuccess = prop.get("findPostServiceByPIDSuccess").toString();
        findPostServiceByPIDFail = prop.get("findPostServiceByPIDFail").toString();

        //站点模块
        getAllStationsSuccess = prop.get("getAllStationsSuccess").toString();
        getStationByIdSuccess = prop.get("getStationByIdSuccess").toString();
        addStationSuccess = prop.get("addStationSuccess").toString();

        //运输订单模块
        findAllPostOrders = prop.get("findAllPostOrders").toString();
        findAllDriversSuccess = prop.get("findAllDriversSuccess").toString();
        findAllDriversFail = prop.get("findAllDriversFail").toString();


        //管理员模块
        findAllAdminSuccess = prop.get("findAllAdminSuccess").toString();
        addAdminSuccess = prop.get("addAdminSuccess").toString();
        addAdminFail = prop.get("addAdminFail").toString();
        deleteAdminSuccess = prop.get("deleteAdminSuccess").toString();
    }

    /*会员模块操作信息*/
    public final static String GETALLSTUDENTSUCCESS = getAllStudentSuccess;
    public final static String GETALLSTUDENTFAIL = getAllStudentFail;
    public final static String GETSTUDENTBYIDSUCCESS = getStudentByIdSuccess;
    public final static String GETSTUDENTBYIDFAIL = getStudentByIdFail;
    public final static String ADDSTUDENTSUCCESS = addStudentSuccess;

    //教师模块
    public final static String GETEACHERSUCCESS = getTeachersSuccess;

    //后期服务模块
    public final static String FINDALLPOSTSERVICESUCCESS = findAllPostServiceSuccess;
    public final static String ADDPOSTSERVICESUCCESS = addPostServiceSuccess;
    public final static String CHANGEPOSTSERVICE = changePostService;
    public final static String FINDPOSTSERVICEBYPIDSUCCESS = findPostServiceByPIDSuccess;
    public final static String FINDPOSTSERVICEBYPIDFAIL = findPostServiceByPIDFail;

    //站点模块
    public final static String GETALLSTATIONSSUCCESS = getAllStationsSuccess;
    public final static String GETSTATIONBYIDSUCCESS = getStationByIdSuccess;
    public final static String ADDSTATIONSUCCESS = addStationSuccess;




    //运输订单模块
    public final static String FINDALLPOSTORDERS = findAllPostOrders;
    public final static String FINDALLDRIVERSSUCCESS = findAllDriversSuccess;
    public final static String FINDALLDRIVERSFAIL = findAllDriversFail;

    //管理员模块
    public final static String FINDALLADMINSUCCESS = findAllAdminSuccess;
    public final static String ADDADMINSUCCESS = addAdminSuccess;
    public final static String ADDADMINFAIL = addAdminFail;
    public final static String DELETEADMINSUCCESS = deleteAdminSuccess;

    public static void main(String[] args) {

    }

}
